﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="TCS.Web.Admin.NewsManage.Index" %>

<%@ Register Src="../../Controls/copyright.ascx" TagName="copyright" TagPrefix="uc1" %>
<%@ Register Src="../../Controls/checkright.ascx" TagName="checkright" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <style type="text/css">
        html, body
        {
            height: 100%;
        }
        body
        {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
            padding: 0px;
        }
    </style>
    <link href="../css/text.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <table width="100%"  border="0" cellspacing="0" cellpadding="0" style="width: 100%
       ">
        <tr>
            <td valign="top" bgcolor="#F4FBFF">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                   <tr bgcolor="#f4fbff">
                        <td valign="top" ><table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#4187b7">
                          <tr>
                            <td height="25" bgcolor="#52A6DE"><table width="88%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td>&nbsp;&nbsp; 快速查询：</td>
                                <td><asp:DropDownList runat="server" ID="dropInfoType" Visible="false"> </asp:DropDownList></td>
                                <td><asp:TextBox ID="txtKey" runat="server" Text="请输入关键字" ToolTip="请输入关键字" BorderStyle="Groove"></asp:TextBox></td>
                                <td><asp:DropDownList ID="DropField" runat="server" Width="150px">
                                  <asp:ListItem Value="Heading">标题</asp:ListItem>
                                  <asp:ListItem Value="Focus">关键字</asp:ListItem>
                                  <asp:ListItem Value="Content">内容</asp:ListItem>
                                </asp:DropDownList></td>
                                <td><asp:ImageButton ID="btn_Search" runat="server" ToolTip="快速检索广告" ImageUrl="..\images\left_32.gif"
                                    OnClick="btn_Search_Click"></asp:ImageButton></td>
                              </tr>
                            </table></td>
                          </tr>
                        </table>
                          <table width="100%" height="10" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td></td>
                            </tr>
                          </table>
                          <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td bgcolor='<%=Application[Session["Style"].ToString()+"xtable_bgcolor"]%>'>
                                        <asp:GridView ID="gridView" runat="server" AutoGenerateColumns="False" 
                                            Width="100%" AllowSorting="True" OnRowCreated="gridView_RowCreated" OnPageIndexChanging="gridView_PageIndexChanging"
                                            OnRowDataBound="gridView_RowDataBound" CellPadding="5" BorderWidth="1px" PageSize="15"
                                            OnRowDeleting="gridView_RowDeleting" OnSorting="gridView_Sorting" 
                                            DataKeyNames="NewsId" AllowPaging="True">
                                            <Columns>
                                                <asp:TemplateField HeaderText="序号" SortExpression="NewsId" ItemStyle-HorizontalAlign="Center">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label2" runat="server" Text='<%# GetNum(Container.DataItemIndex.ToString()) %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("NewsId") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <HeaderStyle BorderColor="#AFC4E3" />
                                                    <ItemStyle BorderColor="#AFC4E3" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="文章标题">
                                                    <ItemTemplate>
                                                        <asp:HyperLink ID="HyperLink1" runat="server"   NavigateUrl='<%# Eval("NewsId", "show.aspx?id={0}") %>' Text='<%# CutString(Eval("Heading"),15) %>' ToolTip='<%# Eval("Heading") %>'></asp:HyperLink>
                                                    </ItemTemplate>
                                                    <HeaderStyle BorderColor="#AFC4E3" />
                                                    <ItemStyle BorderColor="#AFC4E3" CssClass="tdleft" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="区域及发布人"  HeaderStyle-BorderColor="#afc4e3" ItemStyle-BorderColor="#afc4e3">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text='<%# GetName(Eval("Frequency"),Eval("userid")) %>'></asp:Label>
                                                    </ItemTemplate>

<HeaderStyle BorderColor="#AFC4E3"></HeaderStyle>

<ItemStyle BorderColor="#AFC4E3"></ItemStyle>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="Dormancy" HeaderText="类型"  
                                                    HeaderStyle-BorderColor="#afc4e3" ItemStyle-BorderColor="#afc4e3" ItemStyle-HorizontalAlign="Center">
<HeaderStyle BorderColor="#AFC4E3"></HeaderStyle>

<ItemStyle BorderColor="#AFC4E3"></ItemStyle>
                                                </asp:BoundField>
                                                <asp:BoundField DataField="IsTop" HeaderText="审核标志" 
                                                    HeaderStyle-BorderColor="#afc4e3" ItemStyle-BorderColor="#afc4e3" ItemStyle-HorizontalAlign="Center">
<HeaderStyle BorderColor="#AFC4E3"></HeaderStyle>

<ItemStyle BorderColor="#AFC4E3"></ItemStyle>
                                                </asp:BoundField>
                                                <asp:BoundField DataField="ClassId" HeaderText="所属栏目"  
                                                    HeaderStyle-BorderColor="#afc4e3" ItemStyle-BorderColor="#afc4e3">
<HeaderStyle BorderColor="#AFC4E3"></HeaderStyle>

<ItemStyle BorderColor="#AFC4E3"></ItemStyle>
                                                </asp:BoundField>
                                                <asp:TemplateField HeaderText="时间" ItemStyle-HorizontalAlign="Right" >
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label3" runat="server" ToolTip="<%# Bind('IssueDate') %>" Text='<%# Convert.ToDateTime(DataBinder.Eval(Container, "DataItem.IssueDate")).ToString( "yyyy-MM-dd ")%>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("IssueDate") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <HeaderStyle BorderColor="#AFC4E3" />
                                                    <ItemStyle BorderColor="#AFC4E3" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="priority" HeaderText="发布区域"  
                                                    HeaderStyle-BorderColor="#afc4e3" ItemStyle-BorderColor="#afc4e3" ItemStyle-HorizontalAlign="Center">
<HeaderStyle BorderColor="#AFC4E3"></HeaderStyle>

<ItemStyle BorderColor="#AFC4E3"></ItemStyle>
                                                </asp:BoundField>
                                                <asp:HyperLinkField HeaderText="修改" DataNavigateUrlFields="NewsId" DataNavigateUrlFormatString="modify.aspx?id={0}"
                                                    Text="修改" Visible="False"  HeaderStyle-BorderColor="#afc4e3" 
                                                    ItemStyle-BorderColor="#afc4e3">
<HeaderStyle BorderColor="#AFC4E3"></HeaderStyle>

<ItemStyle BorderColor="#AFC4E3"></ItemStyle>
                                                </asp:HyperLinkField>
                                                <asp:TemplateField HeaderText="删除" ShowHeader="False" Visible="False" HeaderStyle-BorderColor="#afc4e3" ItemStyle-BorderColor="#afc4e3">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                                            OnClientClick='return confirm("您真的要删除这条记录吗？")' Text="删除"></asp:LinkButton>
                                                    </ItemTemplate>

<HeaderStyle BorderColor="#AFC4E3"></HeaderStyle>

<ItemStyle BorderColor="#AFC4E3"></ItemStyle>
                                                </asp:TemplateField>
                                            </Columns>
                                            <PagerSettings Mode="NumericFirstLast" />
                                            <PagerStyle HorizontalAlign="Right" VerticalAlign="Middle" /><headerstyle CssClass="bj"></headerstyle>
                                        </asp:GridView>
                                        <asp:Label ID="labResult" runat="server" Visible="False" ForeColor="Red">没有数据！！</asp:Label>
                                       <div style="display:none"><uc1:copyright ID="Copyright1" runat="server" />
                                        <uc2:checkright ID="Checkright1" runat="server" /></div>
                                    </td>
                                </tr>
                          </table>
						  <table width="100%" height="10" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td></td>
                            </tr>
                          </table>
						  <table width="96%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CEDEED">
                <tr>
                  <td height="25" bgcolor="#ecf5fd" style="padding-left:10px;"><table cellspacing="0" cellpadding="0" width="100%" border="0" align="center">
                    <tr>
                      <td align="left"> 页次：
                          <asp:Label ID="lblCurrentPage" runat="server" ForeColor="#e78a29"></asp:Label>
                        页/
                        <asp:Label
                                            ID="lblPageCount" runat="server"></asp:Label>
                        页，共
                        <asp:Label ID="lblRowsCount" runat="server"
                                                ForeColor="#e78a29"></asp:Label>
                        条记录 </td>
                      <td align="right"> [
                          <asp:LinkButton ID="btnFirst" runat="server" OnCommand="NavigateToPage" CommandArgument="First"
                                            CommandName="Pager" Text="首 页">首 页</asp:LinkButton>
                        ] [
                        <asp:LinkButton ID="btnPrev"
                                                runat="server" OnCommand="NavigateToPage" CommandArgument="Prev" CommandName="Pager"
                                                Text="上一页">上一页</asp:LinkButton>
                        ] [
                        <asp:LinkButton ID="btnNext" runat="server" OnCommand="NavigateToPage"
                                                    CommandArgument="Next" CommandName="Pager" Text="下一页">下一页</asp:LinkButton>
                        ]
                        [
                        <asp:LinkButton ID="btnLast" runat="server" OnCommand="NavigateToPage" CommandArgument="Last"
                                            CommandName="Pager" Text="尾 页">尾 页</asp:LinkButton>
                        ] &nbsp;</td>
                    </tr>
                  </table></td>
                </tr>
              </table>
                     </td>
                  </tr>
              </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
